"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!==_typeof(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}new(function(){function e(t,r,o,n,i,l){_classCallCheck(this,e),this.marginBetweenElements=n,this.firstControllButtonId=i,this.elementsFromClick=l,this.carousel=document.querySelector(t),this.firstEl=document.querySelectorAll(r)[0],this.controllButtons=document.querySelectorAll(o)}return _createClass(e,[{key:"sliderInit",value:function(){var e,t,r=this,o=!1;this.controllButtons.forEach(function(e){return e.addEventListener("click",function(){var t=r.firstEl.clientWidth+r.marginBetweenElements;r.carousel.scrollLeft+=e.id=="".concat(r.firstControllButtonId)?-t*r.elementsFromClick:t*r.elementsFromClick})}),this.carousel.addEventListener("mousedown",function(n){o=!0,e=n.pageX,t=r.carousel.scrollLeft}),this.carousel.addEventListener("mousemove",function(n){if(o){n.preventDefault(),r.carousel.classList.add("dragging");var i=n.pageX-e;r.carousel.scrollLeft=t-i}}),this.carousel.addEventListener("mouseup",function(e){o=!1,r.carousel.classList.remove("dragging")}),this.carousel.addEventListener("mouseleave",function(e){o=!1,r.carousel.classList.remove("dragging")})}}]),e}())(".gallery__carousel__line",".gallery__carousel__line__element",".gallery__carousel__controll",30,"galleryCarouselLeft",1).sliderInit();